package com.changgou.web.gateway.filter;

public class UrlFilter {

    private static String filterPath = "/api/wseckillorder,/api/seckill,/api/wxpay/**,/api/worder/**,/api/user/**,/api/address/**,/api/wcart/**,/api/cart/**,/api.categoryReport/**,/api/orderConfig/**,/api/order/**,/api/orderItem/**,/api/preferential/**,/api/orderLog/**,/api/returnCause,/api/returnOrder/**,/api/returnOrderItem/**";

    public static boolean hasAuthorize(String url){
        String[] path = filterPath.replace("**", "").split(",");
        for (String value : path) {
            //需要令牌的指令
            if (url.startsWith(value)){
                return true;
            }
        }
        //不需要令牌的指令
        return false;
    }

}